package com.example.exeption;

/**
 * @author ljs
 * @date 2025/7/25
 */
public class BusinessException extends RuntimeException {
    private int code;  // 错误码
    private String message;  // 错误消息

    public BusinessException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public BusinessException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }

    // getter方法
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}